﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class controls_wucBredcrump : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void SiteMapPath1_ItemDataBound(object sender, SiteMapNodeItemEventArgs e)
    {
        if (e.Item.ItemType == SiteMapNodeItemType.Current)
        {
            Literal litNode = e.Item.FindControl("litNode") as Literal;
            litNode.Text = e.Item.SiteMapNode.Description;
        }
        else if (e.Item.ItemType == SiteMapNodeItemType.Root)
        {
            HyperLink hplnkNode = e.Item.FindControl("hplnkNode") as HyperLink;
            hplnkNode.Style.Add(HtmlTextWriterStyle.Display, "none");
        }
        else if (e.Item.ItemType != SiteMapNodeItemType.PathSeparator)
        {
            HyperLink hplnkNode = e.Item.FindControl("hplnkNode") as HyperLink;
            hplnkNode.Text = e.Item.SiteMapNode.Description;
            hplnkNode.NavigateUrl = e.Item.SiteMapNode.Url;
        }
        else if (e.Item.ItemType == SiteMapNodeItemType.PathSeparator)
        {
            if (e.Item.ItemIndex == 1)
            {
                HtmlGenericControl spnNode = e.Item.FindControl("spnNode") as HtmlGenericControl;
                spnNode.Style.Add(HtmlTextWriterStyle.Display, "none");
            }
        }
        else
        {
            //Do Nothing
        }
    }
}
